package com.security.door.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.security.door.core.base.BaseService;
import com.security.door.dao.mapper.crPersionAreaMapper;
import com.security.door.model.domain.crPersionArea;
import com.security.door.model.dto.crPersionAreaDto;
import com.security.door.model.vo.crPersionAreaVo;
import com.security.door.service.IcrPersionAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class crPersionAreaServiceImpl extends BaseService<crPersionArea> implements IcrPersionAreaService {
    @Autowired
    crPersionAreaMapper icrPersionAreaMapper;

    public PageInfo<crPersionAreaVo> queryListWithPage(crPersionAreaDto entity) {
        PageHelper.startPage(entity.getPageIndex(), entity.getPageSize());
        var actionList = icrPersionAreaMapper.queryListWithPage(entity);
        return new PageInfo<>(actionList);
    }

    public Integer deleteByPersionCode(String persionCode) {
        return icrPersionAreaMapper.deleteByPersionCode(persionCode);
    }

    public Integer deleteByPersionArea(crPersionArea entity) {
        return icrPersionAreaMapper.deleteByPersionArea(entity);
    }

}
